package com.lhd.creational.factory.method;

/**
 * @Author: liuhd
 * @Date: 2024/10/20 11:13
 * @Description:
 */
public class CoffeeStore {
    private CoffeeFactory coffeeFactory;

    public void setFactory(CoffeeFactory coffeeFactory) {
        this.coffeeFactory = coffeeFactory;
    }

    public Coffee getCoffee() {
        Coffee coffee = coffeeFactory.creatCoffee();
        coffee.addMilk();
        coffee.addSugar();
        return coffee;
    }
}
